/**
 * 
 * xtype = cceafsjjhgzdyfl
 * 数据交换表式订阅字段转换
 * @module Ext-ux-cceaf-control
 * @class cceaf.control.sjjh.SjjhGzdy
 * @extends Ext.form.ComboBox
 * @since 1.0
 */
Ext.define('cceaf.control.sjjh.SjjhGzdyFl',{
	extend: 'Ext.form.field.ComboBox', 
    alias: 'widget.cceafsjjhgzdyfl',

	constructor: function(config){
		config = config || {};

		var value;
		if(config.value){
			value = config.value;
		}
		else{
			value = '';
		}
		
		var store = config.store;
		
		store = new Ext.data.Store({
	    	model: 'cceaf.model.main.CceafCode',
	    	autoLoad: false,
	    	proxy: {
	    		type: 'ajax',
	    		url: 'sjjh/bsjhSjdyGzdy!getGzdyList.action'
			}
	    });
		
		config = Ext.applyIf(config, {
			typeAhead: true,
			editable: true,
			autoSelect: true,
			autoRender: true,
			
		    triggerAction: 'all',
		    lazyRender: false,
		    queryMode: 'remote',
		    forceSelection: true,
		    store: store,
		    valueField: 'value',
		    displayField: 'name',
		    //value: value,
		    listeners: {
		    	load: function(){
		    		this.setValue(this.store.getAt(0).data.value);
		    	}
	        }
		});

		cceaf.control.sjjh.SjjhGzdyFl.superclass.constructor.apply(this, arguments);
	},
	
	/**
	 * 代码值
	 *
     * @property value 
     * @type String
     * @default ''
     */
	value: '',
	
	allowBlank: true,
	
	width: 120,
	
    getValue: function() {
        return this.value;
    }
    
});